import axios from "axios";

let http = axios.create({
  //会把传入的对象当成axios的prototype
  baseURL: "/api", //配置默认的url
  withCredentials: true, //将会默认携带认证给后端
  timeout: 1000 * 10, //请求超时设置,如果超过10s就会进入reject
});
http.interceptors.request.use(function (config) {
  let rowPaths = ["/users/getCaptcha", "/users/login", "/users/verifyCaptcha"];
  // console.log(config);
  
  return config;
}); //请求拦截器,可以拦截所有的请求,然后添加我们需要的逻辑
export default http;
